#!/usr/bin/env python

import re,sys,urllib

url = "https://cws.connectedpdf.com/dev/health-check"
wp = urllib.urlopen(url)
content=wp.read()
# \s+ :Match multiple spaces
#keywords = re.findall(r'<div class="content">\r\n\s+(.+?)<br/><hr/>(.+?)\s+</div>',content)
keywords = re.findall(r'<div class="content">\r\n(.+?)<br/><hr/>(.+?)</div>',content)


if keywords[0][1].strip() == "RestHeart connect success.":
	print "RestHeart connect success!"
	sys.exit(0)
else:
	print keywords[0][1].strip()
	sys.exit(2)
